﻿@model IEnumerable<PortalBusiness.Models.CAIXA>

@{
    ViewBag.Title = "Index";
}
@Styles.Render("~/Content/jquery-ui")



 <h3>Caixa</h3><div></div>
<p>
    @if (ViewBag.MostrarIncluir)
    {
        @Html.ActionLink("Cadastrar novo", "Incluir")
    }
</p>

<table class="table">

    <tr>
        <th>
            @Html.DisplayNameFor(model => model.DATA) <br />
            @Html.DisplayNameFor(model => model.CAIXA_OBSERVACAO)
        </th>
        @foreach (PortalBusiness.Models.COLUNA item in ViewBag.COLUNAS)
        {
            <th>
                @item.NOME
            </th>

        }
        <th>
            @Html.DisplayNameFor(model => model.CAIXA_SANGRIA)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CAIXA_TOTAL)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CAIXA_FITA)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CAIXA_QUEBRA)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.STATUS)
        </th>
        <th></th>
    </tr>


@foreach (var item in Model) {
    <tr>
        <td class="nopadding">
            @Html.DisplayFor(modelItem => item.DATA)
            @Html.DisplayFor(modelItem => item.CAIXA_OBSERVACAO)
        </td>
        @foreach (PortalBusiness.Models.CAIXA_COLUNA item2 in item.COLUNAS)
        {
            <th>
                @item2.VALOR.ToString("####0.00")
            </th>
        }
        <td class="nopadding">
            @Html.DisplayFor(modelItem => item.CAIXA_SANGRIA)
        </td>
        <td class="nopadding">
            @Html.DisplayFor(modelItem => item.CAIXA_TOTAL)
        </td>
        <td class="nopadding">
            @Html.DisplayFor(modelItem => item.CAIXA_FITA)
        </td>
        <td class="nopadding">
            @Html.DisplayFor(modelItem => item.CAIXA_QUEBRA)
        </td>
        <td class="nopadding">
            @if (item.STATUS == 0)
            {
                <b>Não</b>
                @Html.ActionLink("Editar", "Edit", new { id = item.CAIXAID })
            }
            else
            {
                <b>Sim</b>
            }
        </td>
        <td>
        </td>
    </tr>
}


</table>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/jquery-ui")
}
